package com.qeegoo.b2bautozityp.moudle.good.view.category;

import com.qeegoo.b2bautozityp.R;
import com.qeegoo.b2bautozityp.databinding.ActivityGoodsCategorySearchBinding;
import com.qeegoo.b2bautozityp.injector.component.DaggerGoodsActivityComponent;
import com.qeegoo.b2bautozityp.moudle.base.BaseActivity;
import com.qeegoo.b2bautozityp.moudle.good.viewmodel.category.GoodsCategorySearchViewModel;

import javax.inject.Inject;

import base.lib.widget.recyclerview.DividerLinearItemDecoration;

/**
 * 王少岩 在 2017/9/20 创建了它
 */

public class GoodsCategorySearchActivity extends BaseActivity<ActivityGoodsCategorySearchBinding> {
    @Inject
    GoodsCategorySearchViewModel mViewModel;

    @Override
    protected int attachLayoutRes() {
        return R.layout.activity_goods_category_search;
    }

    @Override
    protected void initInjector() {
        DaggerGoodsActivityComponent.builder().appComponent(getAppComponent()).activityComponent(getActivityComponent()).build().inject(this);
    }

    @Override
    protected void initViews() {
        mBinding.setViewModel(mViewModel);
        mBinding.rvCategory.setAdapter(mViewModel.getAdapter());
        mBinding.rvCategory.addItemDecoration(new DividerLinearItemDecoration(this, DividerLinearItemDecoration.HORIZONTAL_LIST, R.drawable.divider_h));
    }
}
